<?php

namespace common\base;

use Yii;

/**
 * ErrorHandler handles uncaught PHP errors and exceptions.
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class ErrorHandler extends \yii\web\ErrorHandler {

    /**
     * Logs the given exception.
     * @param \Exception $exception the exception to be logged
     * @since 2.0.3 this method is now public.
     */
    public function logException($exception) {
        if (!YII_DEBUG) {
            //Yii::$app->log->targets['file']->enabled = false;
        }
        parent::logException($exception);
    }

}
